﻿<UserControl
    x:Class="BootyBay.PrivateStoreApp.Controls.FlipViewControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BootyBay.PrivateStoreApp.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:common="using:BootyBay.PrivateStoreApp.Common"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <UserControl.Resources>
        <common:ImagesMenuConverter x:Key="ImagesMenuConverter"></common:ImagesMenuConverter>
        <common:ScreenshotUrlListConverter x:Key="ScreenshotUrlListConverter"></common:ScreenshotUrlListConverter>
    </UserControl.Resources> 
    <Grid DataContext="{Binding AppModel}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="15"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <GridView x:Name="itemGridView" Grid.Column="0" VerticalAlignment="Top" Margin="0,3,0,0" ItemsSource="{Binding AppView.ScreenshotUrlList}"
                  SelectionMode="None"
                  IsItemClickEnabled="False"
                  IsSwipeEnabled="false"
                  ItemContainerStyle="{StaticResource ItemDetailPage_ImagesList_Style}">
            <GridView.ItemTemplate>
                <DataTemplate>
                    <RadioButton x:Name="rad_Button" Tag="{Binding Converter={StaticResource ScreenshotUrlListConverter}}" Checked="rad_Button_Checked">
                        <RadioButton.Template>
                            <ControlTemplate>
                                <Border x:Name="border_Bg" Style="{StaticResource FlipViewControl_click_BorderStyle}" Opacity="{Binding ElementName=itemFlipView,Path=SelectedIndex,Converter={StaticResource ImagesMenuConverter}}" Height="40" Width="75">
                                    <Image Source="{Binding}" Width="75" Height="41" VerticalAlignment="Top"/>
                                </Border>
                            </ControlTemplate>
                        </RadioButton.Template>
                    </RadioButton>
                </DataTemplate>
            </GridView.ItemTemplate>
        </GridView>
        <FlipView x:Name="itemFlipView" Grid.Column="2" ItemsSource="{Binding AppView.ScreenshotUrlList}" Loaded="itemFlipView_Loaded">
            <FlipView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </FlipView.ItemsPanel>
            <FlipView.ItemTemplate>
                <DataTemplate>
                    <Image Source="{Binding}" Width="730" Height="440" VerticalAlignment="Top"/>
                </DataTemplate>
            </FlipView.ItemTemplate>
        </FlipView>
    </Grid>
</UserControl>
